import { IFeidaoAiMobile } from '@dfeidao/atom-mobile/interfaces';
import set from '@dfeidao/atom-mobile/local/set';
import nodejs from '@dfeidao/atom-mobile/msg/nodejs';
import render from '@dfeidao/atom-mobile/render/render';
import whoami_getparams from '../atom/whoami_getparams';
export default async function a001(fd: IFeidaoAiMobile) {
	const user = await whoami_getparams(fd) as {
		params: {
			teacher_name: string;
			productid: string;
			teacher_no: string;
		}
	};
	const res = await nodejs<{
		classes: Array<{}>, subject: Array<{}>;
	}>('app-class-work/s001', { teacher_no: user.params.teacher_no, productid: user.params.productid });
	set(fd, 'teacher_no', user.params.teacher_no);
	set(fd, 'teacher_name', user.params.teacher_name);
	set(fd, 'productid', user.params.productid);
	set(fd, 'classes', res.classes);
	set(fd, 'subject', res.subject);
	render(fd, { subject: '', classes: '', zyname: '', zynr: '' });
}
